<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>SetURLPart</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">SetURLPart()</font></b></p>
<p><b>语法</b></p><blockquote>

Result$ = <font color="#3A3966"><b>SetURLPart</b></font>(URL$, Parameter$, Value$)</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Set a specific part of the given URL$. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>URL$</i></td>
<td width="90%"> 
 
The URL to modify. 
A URL$ may contain parameters, which are useful when a scripting language 
such as: (PHP) is being used on that server. The syntax is as follows: (http://www.purebasic.com/index.php3?test=1) 
Here, the parameter is named "test" and its associated value is "1". 
<br>
<br>
In order to set a specific part of a URL, the information provided within "URL$" must (at the minimum), 
be of the following format: ("http://www.purebasic.com") 

 

</td></tr>
<tr><td><i>Parameter$</i></td>
<td> 
 
The parameter to modify. 
The parameters are not case-sensitive. Moreover, Parameter$ may be one of the following constants: 
 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_URL_Protocol</font>: change the protocol of the URL$
  <font color="#924B72">#PB_URL_Site</font>: change the site of the URL$
  <font color="#924B72">#PB_URL_Port</font>: change the port of the URL$ (or adds it if not specified)
  <font color="#924B72">#PB_URL_Parameters</font>: changes all the parameters of the URL$ (or adds it if not specified)
  <font color="#924B72">#PB_URL_Path</font>: changes the path of the URL$ (or adds it if not specified)
  <font color="#924B72">#PB_URL_User</font>: changes the username of the URL$ (or adds it if not specified)
  <font color="#924B72">#PB_URL_Password</font>: changes the password of the URL$  (or adds it if not specified - the "user" needs to exist)
</font></pre>

</td></tr>
<tr><td><i>Value$</i></td>
<td> 
 
The value to assign to the given parameter or URL part. 

 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>



Returns the modified URL. 

 

</blockquote><p><b>示例</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  URL$ = "http://www.test.com/hello.php3"

  URL$ =<font color="#3A3966"> SetURLPart</font>(URL$, <font color="#924B72">#PB_URL_Protocol</font>, "ftp")
  URL$ =<font color="#3A3966"> SetURLPart</font>(URL$, <font color="#924B72">#PB_URL_Site</font>, "www.purebasic.com")
  URL$ =<font color="#3A3966"> SetURLPart</font>(URL$, <font color="#924B72">#PB_URL_Port</font>, "80")
  URL$ =<font color="#3A3966"> SetURLPart</font>(URL$, <font color="#924B72">#PB_URL_Path</font>, "english/index.php3")
  URL$ =<font color="#3A3966"> SetURLPart</font>(URL$, <font color="#924B72">#PB_URL_User</font>, "user")
  URL$ =<font color="#3A3966"> SetURLPart</font>(URL$, <font color="#924B72">#PB_URL_Password</font>, "pass")
  URL$ =<font color="#3A3966"> SetURLPart</font>(URL$, "test", "1")
  URL$ =<font color="#3A3966"> SetURLPart</font>(URL$, "ok", "2")

  <b><font color="#3A3966">Debug</font></b> URL$ <font color="#3A3966">; Will print "ftp://user:pass@www.purebasic.com:80/english/index.php3?test=1&amp;ok=2"</font>

</font></pre>

</blockquote><p><b>参阅</b></p><blockquote>

<a href="geturlpart.html">GetURLPart()</a>, <a href="urlencoder.html">URLEncoder()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=receivehttpmemory.html>ReceiveHTTPMemory()</a> - <a href="index.html">Http Index</a> - <a href="urldecoder.html">URLDecoder()</a> -&gt;<br><br></body></html>